package com.nanyang.tms.dao.waybill;

import com.nanyang.tms.domain.waybill.WaybillDO;
import com.nanyang.tms.domain.waybill.WaybillDetailVO;
import com.nanyang.tms.domain.waybill.WaybillDetailVolumeVO;
import com.nanyang.tms.domain.waybill.WaybillQuery;
import com.nanyang.tms.domain.waybill.WaybillVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>WaybillDao.java</p>
 * <p>Description:()</p>
 *
 * @author lv
 * @date 2022年11月12日 下午10:52:52
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Mapper
public interface WaybillDao {
    /**
     * <p>deleteByPrimaryKey</p>
     * <p>Description:(根据主键删除)</p>
     *
     * @param id
     * @return int
     */
    int deleteByPrimaryKey(Long id);

    /**
     * <p>insert</p>
     * <p>Description:(新增（所有列）)</p>
     *
     * @param record
     * @return int
     */
    int insert(WaybillDO record);


    /**
     * <p>selectByPrimaryKey</p>
     * <p>Description:(根据主键查询)</p>
     *
     * @param id
     * @return WaybillDO
     */
    WaybillDO selectByPrimaryKey(Long id);

    /**
     * <p>updateByPrimaryKeySelective</p>
     * <p>Description:(修改(选择的列))</p>
     *
     * @param record
     * @return int
     */
    int update(WaybillDO record);

    /**
     * <p>countWaybill</p>
     * <p>Description:总数</p>
     *
     * @param query
     * @return
     */
    Integer countWaybill(WaybillQuery query);

    /**
     * <p>listWaybill</p>
     * <p>Description:列表</p>
     *
     * @param query
     * @return
     */
    List<WaybillVO> listWaybill(WaybillQuery query);

    /**
     * 根据商户单号查询运单信息
     * @param supplierNo
     * @return
     */
    WaybillVO selectBySupplierNo(String supplierNo);

    /**
     *
     * @param waybillCode
     * @return
     */
    WaybillVO selectByWaybillCode(String waybillCode);
    
    WaybillDetailVO getWaybillDetailBySupplierNo(String supplierNo);
    
    List<WaybillDetailVolumeVO> getWaybillDetailVolumeBySupplierNo(String supplierNo);
    
    String getCompanyNameBySupplierNo(String supplierNo);

    /**
     * 根据服务商单号查询运单信息
     * @param supplierNo
     * @return
     */
    WaybillVO queryBySupplierNo(String supplierNo);

    /**
     * 更新运单轨迹状态
     * @param trackState
     * @param supplierNo
     * @return
     */
    int updateTrackState(@Param(value = "trackState") Integer trackState,@Param(value = "supplierNo") String supplierNo);

    /**
     * 查询运单信息
     * @param waybillCode
     * @return
     */
    WaybillVO queryDetail(String waybillCode);
}